package Work;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class User {
	public boolean UserLogin(String name,String pass){
	File file = new File("/User.xml");
	boolean a=false;
	try {
		BufferedReader entrada;
		entrada = new BufferedReader( new FileReader( file ) );
		while(entrada.ready() ){
			String namePass[] = new String[2];
			String user = entrada.readLine();
			System.out.println(user);
			namePass = user.split(";");
			System.out.println(namePass.length);
			if(namePass[0].equals(name)&&namePass[1].equals(pass)){
				System.out.println("true");
				return true;
			}
		}
		return a;
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return a;
	}
	public static void main(String arg[]){
		User U=new User();
		U.UserLogin("Cristian", "12345");
	}
}
